/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2002, GeoVISTA Center
 * Licensed under Simplified BSD License
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
*
*
* @author: jin Chen
* @date: Mar 31, 2005$
* @version: 1.0
*/
package edu.psu.geovista.app.pcp.plot.control.actions;


import edu.psu.geovista.app.pcp.plot.control.AxisRangeCfg2;
import edu.psu.geovista.app.pcp.plot.control.ConfigManager;
import edu.psu.geovista.app.pcp.plot.control.DfConfigManager;
import edu.psu.geovista.app.pcp.plot.gui.BasicPcpUI;
import edu.psu.geovista.app.plot.axis.YAxis;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class ShowRangeCfg extends BasicAction {
    YAxis axis=null;
    public ShowRangeCfg() {
       this.putValue(Action.SHORT_DESCRIPTION,"Show Axis Range configuare page.");

    }

    public void actionPerformed(ActionEvent e) {
        BasicPcpUI ui = this.getPcpUI();
        DfConfigManager configMgr = ui.getConfig();
        YAxis axis = this.getAxis();
        if(axis!=null){

        AxisRangeCfg2 cfg = (AxisRangeCfg2) configMgr.getCfg(ConfigManager.CFG_RANGE);
        String name = axis.getName();
        cfg.selectVariable(name);
        //configMgr.showConfig(ConfigManager.CFG_RANGE);

        }
        configMgr.showConfig(ConfigManager.CFG_RANGE);


    }

    
    public YAxis getAxis() {
        return axis;
    }

    public void setAxis(YAxis axis) {
        this.axis = axis;
    }


}
